<!-- start header -->
<div class="header-wrapper clearfix">
	<div id="header">
        <div id="addtocart_popup_container" style="display:none;">
        </div>
        <div id="addtocart_popup_container" style="display:none;">
		<!-- <div id="addtocart_popup_container"> EXTRA DIV NOT NEEDED? -->
		  <div id="addtocart_popup">
		    <div class="modal-header">
		      <b>添加到购物车</b>
		      <a class="close-button" onclick="close_addtocart_popup()" href="#"></a>
		    </div>
		    <div>
		      <div class="clearfix">
		        <!-- <div class="clear"></div> -->
		      </div>
		      <div>
		        <a href="<?php echo $ser?>/cart" class="action-button-inset block">查看</a>
		      </div>
		    </div>
		  </div>
		<!-- </div> EXTRA DIV NOT NEEDED? -->
		</div>
        <script>
		  $('#addtocart_popup_container').prependTo('#header').show();
		  function close_addtocart_popup() {
		    var pop = document.getElementById('addtocart_popup_container');
		    pop.style.display = 'none';
		  }
		</script>
        <a href="<?php echo $ser?>/" id="header-logo">
        </a>
	    <ul id="nav">
            <li class="create boxed">
                <a href="/create">创建</a>
                 <ul class="nav-arrow-box dropdown">
                    <div class="nav-callout">
                        <a href="/create">新产品</a>
                    </div>
                    <li><a href="/materials">材料</a></li>
                    <li><a href="/labs">实验室</a></li>
                </ul>
            </li>
            <li class="discover boxed">
                <a href="/shops">商品</a>
                <ul class="nav-arrow-box dropdown">
                    <li><a href="<?php echo $ser?>/featured">精选热门</a></li>
                    <li><a href="<?php echo $ser?>/art">艺术</a></li>
                    <li><a href="<?php echo $ser?>/fashion">时尚</a></li>
                    <li><a href="<?php echo $ser?>/for-your-home">家居</a></li>
                    <li><a href="<?php echo $ser?>/gadgets">小配件</a></li>
                    <li><a href="<?php echo $ser?>/games">游戏</a></li>
                </ul>
            </li>
            <li class="community boxed">
                <a href="<?php echo $ser?>/community">动态</a>
            </li>
           <li id="header-search" class="boxed">
                <form action="/search" name="topSearchForm" _lpchecked="1">
                    <input type="text" id="new-search" name="q" value="">
                    <div class="search-submit" id="hiddensubmit" onclick="document.topSearchForm.submit()">Go</div>
                </form>
            </li>
            <?php 
            if(0 == $cart_count || 0 == count($cart_count)){
			?>
            <li class="header-cart boxed ">
                <a href="<?php echo $ser?>/cart.php">
                 </a>
            </li>
			<?php
            }else{
            ?>
            <li class="header-cart boxed with-items">
                <a href="<?php echo $ser?>/cart">
						<div id="cartcount"><?php echo $cart_count?></div>
				</a>
			</li>
            <?php 
            }
            ?>
            	<?php 
            		if($is_login){
				?>
				<li class="notifications-nav left boxed" onclick="window.location.href = '/notifications'">
                	@<span class="mentions" id="nav-mention-count">0</span>
            	</li>
				<li class="my-account left last">
	                <div class="user-name">
	                    <a href="<?php echo $ser?>/designer?<?php echo 'n=' . $username .'&i=' . $uid . ''?>">
	                        <div class="avatar">
	                            <img border="0" width="44" height="44" alt="" src="/rrstatic/img/avatar/nopicture-2013031201.png">
	                        </div>
	                    </a>
	                </div>
	                <ul class="nav-arrow-box my-account-dropdown">
	                    <li>
	                        <a class="subnav" href="<?php echo $ser?>/designer?<?php echo 'n=' . $username .'&i=' . $uid . ''?>">
	                            <div class="display-name truncate header-username">
	                                <em><?php echo $username?></em>
	                            </div>
	                            <span class="text-info text-subtle"><small>编辑资料 »</small></span>
	                        </a>
	                    </li>
	                    <li><a class="subnav" href="<?php echo $ser?>/mymodels">我的模型</a></li>
	                    <li><a class="subnav" href="<?php echo $ser?>/cart">我的购物车</a></li>
	                    <li><a class="subnav" href="<?php echo $ser?>/wishlist">收藏和关注</a></li>
	                    <li><a class="subnav" href="<?php echo $ser?>/logout?targetUrl=<?php echo $targetUrl?>">退出</a></li>
	                </ul>
	            </li>
				<?php
					}else{
				?>
				<li class="register left">
	                <a href="<?php echo $ser?>/register">注册</a>
	            </li>
				<li class="login left last" id="header-login">
	                <a href="javascript:void(0);">登录</a>
	                <ul class="nav-login">
	                    <li>
	                        <form action="<?php echo $ser?>/user" method="post" name="top_login">
	                        	<input type="hidden" name="method" value="login"/>
	                            <input type="hidden" name="targetUrl" value="<?php echo $targetUrl?>">
	                            <label class="textbox-label" for="top_username">用户名</label>
	                            <input id="top_username" name="username" type="text" tabindex="1">
	                            <label class="textbox-label" for="top_password">密码</label>
	                            <input id="top_password" name="password" type="password" tabindex="1">
	                            <label class="checkbox-wrap"><input type="checkbox" name="remember" value="1" tabindex="1"> &nbsp;记住登录</label>
	                            <input type="submit" value="登录" class="login-button" tabindex="1">
	                            <center><a class="forgot-login" href="<?php echo $ser?>/forgot_login" tabindex="1">忘记密码?</a></center>
	                        </form>
	                    </li>
	                </ul>
	            </li>
				<?php	
					}
            	?>
		</ul>
	</div>
</div>
<!-- end header -->